import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import Layout from './layout';
import { ConfigProvider, Modal, message } from '@aurum/pfe-ui';
import zh_CN from '@aurum/pfe-ui/es/locale/zh_CN';
import en_US from '@aurum/pfe-ui/es/locale/en_US';

const PREFIX = 'isc';

const locale = localStorage.getItem('locale') === 'en' ? en_US : zh_CN;

Modal.config({
  rootPrefixCls: 'isc',
});

message.config({
  prefixCls: 'isc-message',
});

export default function App() {
  return (
    <section id={`${PREFIX}-container`}>
      <ConfigProvider locale={locale} prefixCls={PREFIX}>
        <BrowserRouter>
          <Layout />
        </BrowserRouter>
      </ConfigProvider>
    </section>
  );
}
